home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 April / EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso / classx / util / xfa_util / arexx / adpro_othertoxfa.rexx < prev    next >
OS/2 REXX Batch file  |  1998-03-09  |  4KB  |  104 lines

  1. /*
  2. ** Other To XFA REQUESTER - ADPro Arexx Script Converter
  3. **
  4. ** This code shows how to open a File Requester
  5. ** For setting:
  6. **    Input Anim Fotmat
  7. **    Input Anim Name
  8. **    Output Anim Name.
  9. **
  10. ** This code (C)Copyright Fabio Rotondo.
  11. ** It is given as Freeware example and may not be used
  12. ** for any commercial product.
  13. **
  14. */
  15.  
  16. ADDRESS "XFA.1"                 /* Let's ADDRESS XFA */
  17. CountFormat ""
  18. SetPath ADPro "ADPro:ADPro"     /* Set ADPro Path    */
  19. CallProcessor ADPro             /* Call ADPro        */
  20.  
  21. ADDRESS "ADPro"               /* Let's ADDRESS ADPro          */
  22. LFORMAT '"ANIM"'              /* Default Input File Format    */
  23. SFORMAT '"IFF"'               /* We have to save it as a IFF  */
  24. OPTIONS RESULTS
  25.  
  26. sparename = "T:Frame" /* Name of file to be processed */
  27.  
  28. /* Here we ask for an Anim File Format          */
  29. /* Please, note that even if NOT-anim formats   */
  30. /* Are listed, they may not be taken.           */
  31. /* NOTE WELL: This script may not work with all */
  32. /* anim formats. It is just an example.         */
  33. GETLIST LOADERS
  34. IF RC = 10 THEN exit       /* If something go wrong, we abort the script */
  35. loadlist = ADPRO_RESULT
  36.  
  37. LISTVIEW '"Select An Anim Format"' 8 SORT ITEMS loadlist
  38. IF RC ~=0 THEN exit
  39. animformat = ADPRO_RESULT
  40. SAY animformat
  41. exit
  42.  
  43. LFORMAT animformat          /* Here we set the new loader format */
  44.  
  45. /* Here we ask for an Anim File name for input */
  46. GETFILE '"Select An Anim File To Convert"'
  47. IF RC = 10 THEN exit     /* If user press cancel, we abort the script */
  48. animname = ADPRO_RESULT  /* We store ANIM file name into animname     */
  49.  
  50. /* Here we ask for a Output XFA Anim File Name for output */
  51. GETFILE '"Save XFA Anim as..."'
  52. IF RC = 10 THEN exit     /* Same as Above...*/
  53. outname = ADPRO_RESULT
  54.  
  55. frames = 0                            /* Number of frames of the Anim */
  56. LOAD animname COUNT                   /* Let's count the Anim Frames */
  57. frames = ADPRO_RESULT-2               /* frames = ADPro's Result     */
  58.  
  59. LOAD animname FRAME 1                 /* Now we load the 1st Frame    */
  60. EXECUTE                               /* We render it into ADPro      */
  61. PSTATUS LOCKED                        /* And Lock The Palette next    */
  62.                                       /* Frames will be remapped is   */
  63.                                       /* We need it. (Multi pal anims)*/
  64.  
  65. SAVE sparename||0 IMAGE               /* Save it into T:Frame0        */
  66.  
  67.  
  68. ADDRESS "XFA.1"          /* Now we call XFA (port is XFA.1)    */
  69. FirstFrame 0             /* We Set FirstFrame to 0             */
  70. LastFrame frames         /* We Set LastFrame to Anim Frames    */
  71. Compression 32I          /* Set Compression to  32I            */
  72. CloseAnim LOOP           /* Set AnimClose Mode to  LOOP        */
  73. InputName sparename      /* Input Root Name is T:Frame         */
  74. OutputName outname       /* XFA Animation Name will be T:a.xfa */
  75. SetProcessor ADPro       /* We Select ImageProcessor Program   */
  76. InitXFA                  /* XFA Initialization                 */
  77.                          /* NOTE: BEFORE call InitXFA you have */
  78.                          /* To perform AT LEAST all settings   */
  79.                          /* We have done inside this example.  */
  80.                          /* Also remember of having the FIRST  */
  81.                          /* Frame of the ANIM saved as IFF, for*/
  82.                          /* Configuring correctly XFA          */
  83.  
  84. DO t=1 TO frames                        /* For t=1 TO NFrames... */
  85.     ADDRESS "ADPro"                     /* Call ADPro            */
  86.     LOAD animname FRAME t               /* Load Frame N          */
  87.     EXECUTE                             /* Render It             */
  88.     x = t-1
  89.     n = sparename||x
  90.     SAVE n  IMAGE                       /* Save Picture          */
  91.  
  92.     ADDRESS "XFA.1"                     /* Call XFA              */
  93.     GetFrame (t-1)                      /* Load This Frame       */
  94.     PutFrame                            /* Put It Inside Anim    */
  95. END                                     /* Next                  */
  96.  
  97. CloseXFA                                /* Here We Close XFA Anim*/
  98. Message '"Conversion done."'
  99.  
  100. ADDRESS "ADPro"
  101. PSTATUS UNLOCKED
  102.  
  103. exit                                    /* End Of Arexx Script!! */
  104.